/*
 * @Author: thats-all-right-ha-ha 8280209+thats-all-right-ha-ha@user.noreply.gitee.com
 * @Date: 2024-02-26 20:54:20
 * @LastEditors: thats-all-right-ha-ha 8280209+thats-all-right-ha-ha@user.noreply.gitee.com
 * @LastEditTime: 2024-03-07 19:44:19
 * @FilePath: \hrManage\src\api\role.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import instance from '@/utils/request'
export const getRole = (data) => {
  return instance.get('/sys/role', {
    params: data
  })
}

export const addRole = (data) => {
  return instance.post('/sys/role', data)
}

export const updateRole = (data) => {
  return instance.put(`/sys/role/${data.id}`, data)
}

export const delRole = (id) => {
  return instance.delete(`/sys/role/${id}`)
}

export const getEnabled = () => {
  return instance.get('/sys/role/list/enabled')
}

export const getRoleDetail = (id) => {
  return instance.get(`/sys/role/${id}`)
}

export const updateRolePer = (data) => {
  return instance.put('/sys/role/assignPrem', data)
}
